#include "BinarySearchTree.h"
#include <iostream>
#include <cstdlib>
#include <vector>
#include <chrono>
#include <ratio>

int main (int argc, char *argv[])
{
    typedef std::chrono::high_resolution_clock myclock;
    int n = -1;
    std::cin >> n;
    double *A=new double[n];
    for (int i=0; i<n ; i++)
	std::cin >> A[i];
    /// Start the timer.
    myclock::time_point beginning = myclock::now();
    BST_sort(A,n);
    /// Finish the timer.
    myclock::duration d = myclock::now() - beginning;
    std::cout << "A: ";
    for (int i=0; i<n ; i++)
	std::cout << A[i]  << " ";
    std::cout << std::endl;
    std::cout << "time: " << d.count() << std::endl;
    return 0;
};
